package com.example.demo.controller;

import com.example.demo.dto.DataxDto;
import com.example.demo.service.DataxToL1Service;
import com.example.demo.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataxToL1Controller {

    @Autowired
    private DataxToL1Service dataxToL1Service;
    @Autowired
    private TestService testService;

    @PostMapping(value = "/synchronous/data")
    public ResponseData synchronousData(@RequestBody(required = false) DataxDto dataxDto) {
        ResponseData responseData = new ResponseData();
        dataxToL1Service.dataxToL1(dataxDto);
        return responseData.ok();
    }


    @GetMapping(value = "/selectSqlNum")
    public ResponseData selectSqlNum() {
        ResponseData responseData = new ResponseData();
        testService.selectSqlNum();
        return responseData.ok();
    }


    @GetMapping(value = "/queryRedisOneKey")
    public ResponseData queryRedisOneKey() {
        ResponseData responseData = new ResponseData();
        testService.queryRedisOneKey();
        return responseData.ok();
    }


    @GetMapping(value = "/queryRedisMoreKey")
    public ResponseData queryRedisMoreKey() {
        ResponseData responseData = new ResponseData();
        testService.queryRedisMoreKey();
        return responseData.ok();
    }




}